/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package algorithm;

import algorithm.BlobFinder.Blob;
import database.DatabaseController;
import java.awt.Point;
import java.math.BigDecimal;
import java.util.ArrayList;
import structure.StructureData;

/**
 *
 * @author mwiatrowski
 */
public class CountAlgorithm {

    private BigDecimal id;
    private StructureData data;
    private DatabaseController database;
    private boolean w1 = false;
    private boolean w2 = false;
    private boolean w3 = false;

    public CountAlgorithm(StructureData data) {
        this.data = data;
        this.database = new DatabaseController();
    }

    private int collinearMethod(Point p1, Point p2, int px, int py) {
        int i, det; //wyznacznik macierzy
        int x[] = new int[3]; //tablica wspolrzednych x punktow
        int y[] = new int[3]; //tablica wspolrzednych y punktow    

        x[0] = p1.x;
        x[1] = p2.x;
        x[2] = px;
        y[0] = p1.y;
        y[1] = p2.y;
        y[2] = py;

//      Oblicznie wyznacznika macierzy
        det = x[0] * y[1] + x[1] * y[2] + x[2] * y[0]
                - x[2] * y[1] - x[0] * y[2] - x[1] * y[0];
//        if (det > 0) {
//            System.out.println("Punkt #3 lezy po lewej stronie wektora #1->#2");
//        } else if (det < 0) {
//            System.out.println("Punkt #3 lezy po prawej stronie wektora #1->#2");
//        } else {
//            System.out.println("Punkty leza na wspolnej prostej");
//        }
        return det;
    }
    
    private int[] getLineFromRect(Blob blob){
 
    return null;
    }

    private void method1(ArrayList<Blob> blobs) {
        for (Blob b : blobs) {

        }
    }

    public void run() {
        
    }

    private void algorithm() {
        
    }

    private void incEntry(BigDecimal id) {
        database.incrementEntry(id);
    }

    private void incExit(BigDecimal id) {
        database.incrementExit(id);
    }

    public StructureData getData() {
        return data;
    }

    public void setData(StructureData data) {
        this.data = data;
    }
}
